import { request } from '../../request';

// get list by page
export function fetchGetHolidayByPage(params: Api.Common.CommonSearchParams) {
  return request<Api.System.Holiday.HolidayQueryRecord>({
    url: '/data/holiday/listByPage',
    method: 'post',
    data: params
  });
}

// delete by id
export function fetchDeleteHolidayById(id: CommonType.IdType) {
  return request({
    url: '/data/holiday/deleteById',
    method: 'post',
    params: {
      id
    }
  });
}

// delete batch by ids
export function fetchDeleteHolidayBatchByIds(ids: CommonType.IdType[]) {
  return request({
    url: '/data/holiday/deleteBatchByIds',
    method: 'post',
    data: ids
  });
}

// save model
export function fetchHolidaySave(model: Api.System.Holiday.HolidayFormModel) {
  return request({
    url: '/data/holiday/save',
    method: 'post',
    data: model
  });
}

// getHolidayDataByApi 从三方接口获取节假日
export function fetchGetHolidayDataByApi() {
  return request({
    url: '/data/holiday/getHolidayDataByApi',
    method: 'post'
  });
}
